#include <stdio.h>
#include <SDL.h>
int main(int argc, char** argv) {
SDL_Surface* screen;
char pause;
// initialize SDL video
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
printf("Unable to init SDL: %s\n", SDL_GetError());
return (-1);
}
// create a new window
screen = SDL_SetVideoMode(640, 480, 16, SDL_HWSURFACE | SDL_DOUBLEBUF);
if (!screen) {
printf("Unable to set 640x480 video: %s\n", SDL_GetError());
return (-1);
}
SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 255, 0, 0));
SDL_Flip(screen); //double buffering
pause = getchar();
return 0;
}
